<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="">班组成员</a></li>
        <li><a href="{:url('Relation/mytask',array('class_id'=>$Request.param.class_id,'status'=>3))}">已发放课题</a></li>
    </ul>
    <form class="well form-inline margin-top-20" >
       
        手机号:
        <input type="number" class="form-control phone" name="phone" style="width: 200px;"
               value="" placeholder="请输入手机号...">
        <input type="hidden" name="class_id" value="{$Request.param.class_id}">
        <input type="button" class="btn btn-primary" value="添加" onclick="play()" />
       
    </form>
    <form method="post" class="js-ajax-form margin-top-20" action="">
       
        
        <table class="table table-hover table-bordered table-list">
            <thead>
            <tr>
                <th width="16"><label><input type="checkbox" class="js-check-all" data-direction="x"
                                             data-checklist="js-check-x"></label></th>
               
                <th width="150">ID</th>
                <th>学生名称</th>
                <th>状态</th>
                <th width="200">{:lang('ACTIONS')}</th>
            </tr>
            </thead>
            <tbody>
            <foreach name="data" item="vo">
                <tr>
                    <td><input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]"
                               value="{$vo.student_id}"></td>
                                <td>{$vo.student_id}</td>
                    <td>{$vo.appuser.realName}</td>
                     <td>{$vo.level.data}</td>
			        
                    <td>
                        <a href="{:cmf_url('remove',array('student_id'=>$vo.student_id))}" class="js-ajax-dialog-btn" data-msg="确定要移除吗？">移除</a>|
                         <if condition="$vo.level.source == 1">
                            设置组长
                        <else/>
                            <a href="{:cmf_url('setLevel',array('student_id'=>$vo.student_id,'class_id'=>$vo.class_id))}" class="js-ajax-dialog-btn" data-msg="确定要设置为组长吗？">设置组长</a>
                        </if>
						
                    </td>
                </tr>
            </foreach>
            </tbody>
            <tfoot>
           <tr>
                <th width="16"><label><input type="checkbox" class="js-check-all" data-direction="x"
                                             data-checklist="js-check-x"></label></th>
               
                <th width="150">ID</th>
                <th>学生名称</th>
                <th width="200">{:lang('ACTIONS')}</th>
            </tr>
            </tfoot>
        </table>
         <ul class="pagination">{$page|default=''}</ul>
    </form>
</div>
<script src="__STATIC__/js/admin.js"></script>
<script type="text/javascript">
    function play() {
        var phone = $('.phone').val();
        
        if(phone == ''){
            alert('请输入手机号');return false;
        }
        class_id = "{$Request.param.class_id}";
   

        $.post("{:cmf_url('addStudent')}",{phone:phone,class_id:class_id},function(data){
            alert(data.msg);
            if(data.code==1){
                setTimeout(window.location.reload(), 1000 )
            }
            
        });
    }
</script>
</body>
</html>